/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */
#include "SymbolModel.h"

namespace QSThink
{
	DirModel::DirModel(QObject *parent)
		: QDirModel(parent)
	{
	}

	QVariant DirModel::data(const QModelIndex &index, int role) const
	{
		if (role == Qt::DisplayRole && index.column() == 0) {
			QString path  = QDir::toNativeSeparators(filePath(index));
			if (path.endsWith(QDir::separator()))
				path.chop(1);
			return path;
		}

		return QDirModel::data(index, role);
	}
}
